package com.qingzhuge.netty;


import com.qingzhuge.netty.client.NettyClient;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author : zero.xiao
 * @description :
 * @date :2018/9/28 0028 下午 15:20
 * @since : 1.0.0
 * @modified :
 */
@Configuration
@ComponentScan
@EnableAutoConfiguration
public class NettyClientApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplicationBuilder builder = new SpringApplicationBuilder(NettyClientApplication.class);
        builder.web(WebApplicationType.NONE);
        builder.run(args);
    }

    @Bean
    public NettyClient nettyClient() {
        return new NettyClient();
    }

    @Override
    public void run(String... arg0) {
        nettyClient().start();
    }
}
